#pragma config(ProgramType, Competition)
#pragma config(Sensor, in1,    touch1,              sensorTouch)
#pragma config(Sensor, in2,    touch2,              sensorTouch)
#pragma config(Motor,  port1,           Drive1,        tmotorNormal, openLoop)
#pragma config(Motor,  port2,           Drive2,        tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port3,           ElevatorMotors, tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port4,           ElevatorMotors2, tmotorNormal, openLoop)
#pragma config(Motor,  port5,           CollectorMotors, tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port6,           CollectorMotors2, tmotorNormal, openLoop)
#pragma config(Motor,  port7,           GoalGrabber,   tmotorNormal, openLoop)
#pragma config(Motor,  port8,           GoalGrabber2,  tmotorNormal, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(0)
#pragma userControlDuration(1200)

#include "Vex_Competition_Includes.c"   //Main competition background code...do not modify!

/////////////////////////////////////////////////////////////////////////////////////////
//
//                          Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////

void pre_auton()
{
	// All activities that occur before the competition starts
	// Example: clearing encoders, setting servo positions, ...
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//                                 Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task autonomous()
{
  /*while(SensorValue(touch2) == 0)
  {
    motor[port5] = -100;
    motor[port6] = -100;

  }
  motor[port5] = 0;
  motor[port6] = 0;




  while(SensorValue(touch1) == 0)
  {
    motor[port1] = 20;
    motor[port2] = 20;
    motor[port3] = 20;
    motor[port4] = 20;
  }

  motor[port1] = 0;
  motor[port2] = 0;
  motor[port3] = 0;
  motor[port4] = 0;

  motor[port7] = -127;
  motor[port8] = -127;
   wait1Msec(7000);

  motor[port7] = 0;
  motor[port8] = 0;

  motor[port1] = -127;
  motor[port2] = -127;
  motor[port3] = -127;
  motor[port4] = -127;
  wait1Msec(1500);

  motor[port1] = 0;
  motor[port2] = 0;
  motor[port3] = 0;
  motor[port4] = 0;*/
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//                                 User Control Task
//
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task usercontrol()
{
	while (1==1)
  {
    motor[port1] = vexRT(Ch2);
    motor[port2] = vexRT(Ch3);

    motor[CollectorMotors] = vexRT(Ch5);
    motor[CollectorMotors2] = vexRT(Ch5);

    motor[ElevatorMotors] = vexRT(Ch6);
    motor[ElevatorMotors2] = vexRT(Ch6);



    motor[GoalGrabber] = vexRT(Ch4);
    motor[GoalGrabber2] = vexRT(Ch4);


   }

}
